#include<iostream>
using namespace std;
#include"FSM.h"

//测试事件变换
void testEvent(FSMItem::Events& event)
{
    switch (event)
    {
    case FSMItem::EVENT1:
        event=FSMItem::EVENT2;
        break;
    case FSMItem::EVENT2:
        event=FSMItem::EVENT3;
        break;
    case FSMItem::EVENT3:
        event=FSMItem::EVENT1;
        break;
    }
}

int main()
{
    FSM *fsm=new FSM();
   
    auto event=FSMItem::EVENT1;

    int count = 8;
    while(count)
    {
        cout<<"evnet  "<<event<<"  iscoming..."<<endl;
        fsm->handleEvent(event);
        cout<<"fsm current state is  :"<<fsm->_curState<<endl;
        testEvent(event);
        count--;
    }
    
    return 0;
}